package LUCKY.Android.BusinessEntities;

import java.util.Hashtable;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

public class UsuarioBE implements KvmSerializable {
	 public int id;
    public String user;
    public int nivel;
    public String nombre;
    public String descripcion;
    public int perfil;
    public String nombreperfil;
   // public int operario;
   // public int campos_chekm_valor;

 //  public int operario;
  //  public int campos_chekm_valor;
    public int autoactualizacion;
    public int docenweb;
    //public int horas_retorno_android;
    
    
    
    @Override
   public String toString() {
   	 StringBuilder sb = new StringBuilder();
   	 sb.append("id: " + id +"\n");
   	 sb.append("user: " + user+"\n");
   	 sb.append("nivel: " + nivel+"\n");
   	 sb.append("nombre: " + nombre+"\n");
   	 sb.append("descripcion: " + descripcion+"\n");
   	 sb.append("perfil: " + perfil+"\n");
   	 sb.append("autoactualizacion: " + autoactualizacion +" : 1 = true ; 0 = false   \n");
	 sb.append("docenweb: " + docenweb +" : 1 = true ; 0 = false   \n");
	 sb.append("nombreperfil: " + nombreperfil+"\n");
	
   	return sb.toString();
   }
    
	@Override
	public Object getProperty(int arg0) {
		// TODO Auto-generated method stub
		switch(arg0)
		{
			case 0:
				return id;
			case 1:
				return user;
			case 2:
				return nivel;
			case 3:
				return nombre;
			case 4:
				return descripcion;
			case 5:
				return perfil;
			case 6:
				return autoactualizacion;
			case 7:
				return docenweb;
			case 8:
				return nombreperfil;
		}
		return null;
	}

	@Override
	public int getPropertyCount() {
		// TODO Auto-generated method stub
		return 9;
	}

	@Override
	public void getPropertyInfo(int index, Hashtable arg1, PropertyInfo info) {
		// TODO Auto-generated method stub
		switch(index)
		{
		case 0:
			info.type = PropertyInfo.INTEGER_CLASS;
			info.name = "ID";
			break;
		case 1:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "USER";
			break;		
		case 2:
			info.type = PropertyInfo.INTEGER_CLASS;
			info.name = "NIVEL";
			break;
		case 3:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "NOMBRE";
			break;
		case 4:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "DESCRIPCION";
			break;
		case 5:
			info.type = PropertyInfo.INTEGER_CLASS;
			info.name = "PERFIL";
			break;
		case 6:
			info.type = PropertyInfo.INTEGER_CLASS;
			info.name = "AUTO_ACTUALIZACION";
			break;
		case 7:
			info.type = PropertyInfo.INTEGER_CLASS;
			info.name = "DOCENWEB";
			break;
		case 8:
			info.type = PropertyInfo.STRING_CLASS;
			info.name = "NOMBREPERFIL";
			break;
		default:break;
		}
	}

	@Override
	public void setProperty(int index, Object value) {
		// TODO Auto-generated method stub
		switch(index)
		{
		case 0:
			id = Integer.valueOf(value.toString());
			break;
		case 1:
			user = value.toString();
			break;	
		case 2:
			nivel = Integer.valueOf(value.toString());
			break;
		case 3:
			nombre = value.toString();
			break;
		case 4:
			descripcion = value.toString();
			break;
		case 5:
			perfil = Integer.valueOf(value.toString());
			break;
		case 6:
			autoactualizacion = Integer.valueOf(value.toString());
			break;
		case 7:
			docenweb = Integer.valueOf(value.toString());
			break;
			
		case 8:
			nombreperfil = value.toString();
			break;
			
		default:
		break;
		}
	}
}
